import request from "@/utils/request";

// 查询试卷列表
export function listPaper(query) {
  return request({
    url: "/paper/paper/list",
    method: "get",
    params: query,
  });
}

// 点击复制后重新查询试卷列表
export function copyPaper(data) {
  return request({
    url: "/paper/paper/copyPaper",
    method: "post",
    data: data,
  });
}

// 查询试卷详细
export function getPaper(id) {
  return request({
    url: "/paper/paper/" + id,
    method: "get",
  });
}

// 新增试卷
export function addPaper(data) {
  return request({
    url: "/paper/paper",
    method: "post",
    data: data,
  });
}

// 修改试卷
export function updatePaper(data) {
  return request({
    url: "/paper/paper/update",
    method: "post",
    data: data,
  });
}
// 删除试卷
export function delPaper(id) {
  return request({
    url: "/paper/paper/delete/" + id,
    method: "post",
  });
}
// 修改examAnswer
export function updateAnswer(data) {
  return request({
    url: "/exam/answer/update",
    method: "post",
    data: data,
  });
}
// 自动组卷
export function autoComposePaper(data) {
  return request({
    url: "/paper/paper/autoComposePaper",
    method: "post",
    data: data,
  });
}

// 导出试卷
export function exportPaper(query) {
  return request({
    url: "/paper/paper/export",
    method: "get",
    params: query,
  });
}
// 查询试卷+答题卡
export function getExamPaper(obj) {
  return request({
    url: "/exam/examinee/startExam",
    method: "post",
    data: obj,
  });
}

// 查询试卷+答题卡
export function getQueryTree() {
  return request({
    url: "/paper/library/queryTree",
    method: "get",
  });
}
